import React, {Component} from 'react';
import {Table} from "@icedesign/base";
import './ApiDataTb.scss'

export default class ApiDataTb extends Component{

    //自动解析成html
    renderRemark = (value) => {
        return (
            <div dangerouslySetInnerHTML={{__html: value}} />
        );
    };

    render(){
        return(
            <div>
                <Table dataSource={this.props.dataSource}>
                    <Table.Column title="参数" dataIndex="param"/>
                    <Table.Column title="说明" dataIndex="remark" cell={this.renderRemark}/>
                    <Table.Column title="可否为空" width={100} dataIndex="isBlack"/>
                    <Table.Column title="默认值" width={100} dataIndex="default"/>
                    <Table.Column title="样例" width={200} cell={this.renderRemark} dataIndex="eg"/>
                </Table>
            </div>
        )
    }
}